Machine Learning with PySpark by Pramod Singh

Machine Learning with PySpark by Pramod Singh

Author:Pramod Singh
Language: eng
Format: epub
ISBN: 9781484241318
Publisher: Apress


If we want to calculate the entropy of our target variable (Insurance Premium), we have to first calculate the probability of each class and then use the above formula to calculate entropy.Insurance Premium

High (9)

Low (5)

The probability of a High category is equal to 9/14 =0.64

The probability of Low category is equal to 5/14 =0.36

Entropy = −p(High)log2(p(High)) − p(Low)log2(p(Low))

= −(0.64 ∗ log2(0.64)) − (0.36 ∗ log2(0.36))

= 0.94

In order to build the decision tree, we need to calculate two kinds of entropy:1.Entropy of Target (Insurance Premium)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.